<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:m="http://www.ol4jsf.org"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:o="http://openfaces.org/">

	
	<script type="text/javascript">
		function zoomToExtent(left, button, right, top) {
			bounds = new OpenLayers.Bounds();
			bounds.left = left;
			bounds.bottom = button;
			bounds.right = right;
			bounds.top = top;
			mapEditor.zoomToExtent(bounds, true);
		}
	</script>

	<h:panelGroup id="zoomFun">
		<script type="text/javascript">
			function doZoom() {
				zoomToExtent(#{interactiveViewerHelper.envelopeLeft}, #{interactiveViewerHelper.envelopeBottom}, #{interactiveViewerHelper.envelopeRight}, #{interactiveViewerHelper.envelopeTop})
			}
		</script>
	</h:panelGroup>

	<br />
	<h3>Zona seleccionada</h3>
	<br />
	<h:panelGroup id="grpSelectedZone">
		<a4j:commandLink
			oncomplete="doZoom()"
			rendered="#{interactiveViewerHelper.selectedZone != null}"
			reRender="zoomFun">
			#{generalHelper.getZoneUsefulName(interactiveViewerHelper.selectedZone)}
			<f:setPropertyActionListener
				target="#{interactiveViewerHelper.zoomedInZone}"
				value="#{interactiveViewerHelper.selectedZone}">
			</f:setPropertyActionListener>
		</a4j:commandLink>
		<h:outputText
			value="No hay seleccion"
			rendered="#{interactiveViewerHelper.selectedZone == null}">
		</h:outputText>
	</h:panelGroup>
	<br />
	<br />
	<h3>Zona(s) resaltada(s)!</h3>
	<br/>
	<h:panelGroup id="grpHighlighted">
		<ui:repeat var="spatialZone" value="#{interactiveViewerHelper.highlightedSpatialZoneList}">
			<a4j:commandLink
				oncomplete="doZoom()"
				reRender="zoomFun">
				#{generalHelper.getZoneUsefulName(spatialZone)}
				<f:setPropertyActionListener
					target="#{interactiveViewerHelper.zoomedInZone}"
					value="#{spatialZone}">
				</f:setPropertyActionListener>
			</a4j:commandLink>
			<br />
			#{' - '}
			<a4j:commandLink value="Seleccionar" immediate="true"
				reRender="grpSelectedZone,#{interactiveViewerHelper.zoneSelectionRerenderString}"
				oncomplete="highlightSelectedZone(#{spatialZone.suID})"
				action="#{interactiveViewerHelper.setSelectedZone(spatialZone)}">
			</a4j:commandLink>
			<br />
		</ui:repeat>
		<rich:messages></rich:messages>
	</h:panelGroup>
	<br />
	<h3>Capa activa</h3>
	<br />
	<h:outputText id="txtActiveLayer" value="#{interactiveViewerHelper.selectedLayer.name}" style="color:Red;font-weight:bold;" />
	<br />
	<br />
	<rich:separator height="3px"/>

		
</ui:component>
